<%--
  Created by IntelliJ IDEA.
  User: Crush
  Date: 2019/11/14
  Time: 2:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!--shiro权限验证-->
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ include file="/WEB-INF/page/include/taglib.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="utf-8">
    <title>资产管理房屋信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1">
    <!--支持移动app显示-->
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <!--支持移动app显示结束-->

    <!--浏览器-->
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta name="format-detection" content="telephone=no">

    <!--lay-ui样式-->
    <link rel="stylesheet" href="${ctx }/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx }/css/font_eolqem241z66flxr.css" media="all"/>
    <link rel="stylesheet" href="${ctx }/css/list.css" media="all"/>

    <!--引用样式-->
    <script>
        var ctx = "${ctx}";
    </script>
</head>


<body>
<form action="" method="post">
    <!--面包屑导航条开始-->
    <div>
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">

        </fieldset>
    </div>
    <!--面包屑导航条结束-->




    <!--表格ID-->
    <table class="layui-table" id="buildVideoTab">

    </table>

</form>

<script type="text/javascript" src="${ctx }/layui/layui.js"></script>
<%--编辑按钮--%>
<script type="text/html" id="barEdit">
    <shiro:hasPermission name="user:user:update">
        <%--ID--%>
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="user:user:delete">
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </shiro:hasPermission>
</script>

<script>
    layui
        .config({
            //配置js
            base: "js/"
        })
        .use(
            //引用
            ['form', 'layer', 'jquery', 'table', 'laydate'],
            function () {
                var form = layui.form,
                    laydate = layui.laydate,
                    table = layui.table,//表ID
                    //$ = layui.$,
                    $ = layui.jquery;//Jquery  引用$


                //加载页面数据
                //table.render({})分页  分页增删改后reload实时刷新当前页面数据
                table.render({
                    id: 'demo',
                    elem: '#buildVideoTab',//与表ID名对应
                    url: ctx + '/audio/video/list'  ,//数据接口,与Controller的访问地址一致
                    limit:10,//每页默认显示10行数据
                    limits:[10,20,30,40],//lay-ui显示的分页为假分页  真分页需要重载页
                    //列名
                    cols: [[{
                        field: 'id',//表头 表头id与封装类名字必须保持一致
                        width: 180,
                        title: 'ID',
                        sort: true
                    }, {
                        field: 'author',
                        width: 180,
                        title: '作者'
                    }, {
                        field: 'des',
                        width: 80,
                        title: '描述',
                        sort: true
                    }, {
                        field: 'videoUrl',
                        width: 80,
                        title: '视频内容'
                    },{
                        field: 'time',
                        width: 80,
                        title: '时长'
                    }, {
                        field: 'src',
                        width: 80,
                        title: '封面'
                    },{
                        field: 'star',
                        width: 80,
                        title: '点赞'
                    },{
                        field: 'createtime',
                        width: 80,
                        title: '创建时间'
                    }, {
                        title : '操作',
                        toolbar : '#barEdit'
                    }]
                    ],
                    //开启分页
                    page:true
                });


            })
</script>
</body>
</html>
